import * as actionTypes from "./constant";

const initialState = {
    counter: 100
}

function reducer(state = initialState, action) {
    switch(action.type) {
        case actionTypes.ADD_NUMBER: 
            return { ...state, counter: state.counter + action.num };
        default:
            return state;
    }
}

export default reducer;